import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Title Test
 * @author youxiang
 * @Date 2017��12��7��
 * TODO TODO
 */
public class Test {
	

	public static void main(String[] args) {
		List<User> l1= addUser();
		List<User> l2= addUser2();
		Iterator<User> i1= l1.iterator();
		while(i1.hasNext()){
			User u = i1.next();
			Iterator<User> i2= l2.iterator();
			while(i2.hasNext()){
				if(String.valueOf(u.getId()).equals(String.valueOf(i2.next().getId()))){
					i1.remove();
				}		
			}
		}
	
		for(User u:l2){
			l1.add(u);
		}
		for(User u2:l1){
			System.out.println(u2);
		}
		
		int i=1;
		
		if(i==0||false||false&&true){
			System.out.println("jinqule");
		}
	}
	
	
	public  static List<User> addUser(){
		
	List<User> list = new ArrayList<User>();
	User u = new User();
	u.setId(1);
	u.setName("hh");
	u.setAge("18");
	list.add(u);
	User u1 = new User();
	u1.setId(2);
	u1.setName("hhh");
	u1.setAge("188");
	list.add(u1);
	User u2 = new User();
	u2.setId(3);
	u2.setName("hhhh");
	u2.setAge("1888");
	list.add(u2);
	User u3 = new User();
	u3.setId(1000);
	u3.setName("hhhh");
	u3.setAge("1888");
	list.add(u3);
		return list;
	}
	public static List<User> addUser2(){
		
		List<User> list = new ArrayList<User>();
		User u = new User();
		u.setId(1);
		u.setName("hh");
		u.setAge("18");
		list.add(u);
		User u1 = new User();
		u1.setId(2);
		u1.setName("hhhhh");
		u1.setAge("18888");
		list.add(u1);
		User u2 = new User();
		u2.setId(3);
		u2.setName("hhhhhh");
		u2.setAge("188888");
		list.add(u2);
		User u3 = new User();
		u3.setId(6);
		u3.setName("hhhhh");
		u3.setAge("18888");
		list.add(u3);
		User u4 = new User();
		u4.setId(7);
		u4.setName("hhhhhh");
		u4.setAge("188888");
		list.add(u4);
			return list;
		}
}
